/**
 * Created by George on 2018/1/28.
 * main.js
 */

'use strict';
(function (win) {
    require.config({
        baseUrl: './',
        // 依赖相对路径
        paths: {
            'angular': '../lib/angular-libs/angular.min',
            'angular-route': '../lib/angular-libs/angular-route.min',
            'angular-ui-route': '../lib/angular-libs/angular-ui-router.min',
            'ueditor-config': '../lib/ueditor/ueditor.config',
            'ueditor': '../lib/ueditor/ueditor.all',
            'ZeroClipboard': '../lib/ueditor/third-party/zeroclipboard/ZeroClipboard',
            'jquery': '../lib/ueditor/third-party/jquery-1.10.2',
            'util': 'js/common/util',
            'frameRouter': 'js/framework/frameRouter',
            'activityCtrl': 'js/activity/activityCtrl',
            'editActivityCtrl': 'js/activity/editActivityCtrl',
            'createActivityCtrl': 'js/activity/createActivityCtrl',
            'duesCtrl': 'js/dues/duesCtrl',
            'editDuesCtrl': 'js/dues/editDuesCtrl',
            'createDuesCtrl': 'js/dues/createDuesCtrl',
            'userCtrl': 'js/user/userCtrl',
            'editUserCtrl': 'js/user/editUserCtrl',
            'createUserCtrl': 'js/user/createUserCtrl',
            'mainCtrl': 'js/framework/mainCtrl',
            'noteCtrl': 'js/note/noteCtrl',
            'createNoteCtrl': 'js/note/createNoteCtrl',
            'editNoteCtrl': 'js/note/editNoteCtrl'
        },
        // 引入没有使用requirejs模块写法的类库
        shim: {
            'angular': {
                exports: 'angular'
            },
            'angular-route': {
                // angular-route依赖angular
                deps: ['angular'],
                exports: 'ngRoute'
            },
            'angular-ui-route': {
                // angular-route依赖angular
                deps: ['angular']
            }
        }
    });

    // 自动导入router.js模块，由于后缀名可以省略，故写作'router',
    // 并将模块返回的结果赋予到router中。
    require(['angular', 'frameRouter'], function (angular, router) {
        // 手动启动angularjs，特别说明此处的bootstrap不是那个ui框架，
        // 而是angularjs的一个手动启动框架的函数
        angular.bootstrap(document, ['appNote']);
    });
})(window);